<?php
/*
Copyright 2011 Erick Martínez Sámano

This file is part of PHP Quick Calendar E.

PHP Quick Calendar E is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

PHP Quick Calendar E is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

<http://www.gnu.org/licenses/>
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport( 'joomla.application.component.view' );

class pqceViewsmall extends JView
{
	function display()
	{
		$params = &JComponentHelper::getParams("com_pqce");
		$exc=$params->get('exclude');
		if (strpos(strtolower($exc),'small') !== false){
			JError::raiseError(403, JText::_('Access Forbidden'));
		}
		$m=JRequest::getVar('month','');
		$y=JRequest::getVar('year','');
		$d= JRequest::getVar('day','');
		$this->loadHelper('base');
		$e=new qcalendareBase($d,$m,$y,false);
		$model=$this->getModel('small');
		$model->init(&$e);
		$cell=$model->createBody($model->createLinks(), $e->cell);
		$this->assignRef('weeksInMonth',$e->weeksInMonth);
		$href=$e->createHrefHeader();
		$this->assignRef('href',$href);
		$this->assignRef('cell',$cell);
		$this->assignRef('month',$e->month);
		$this->assignRef('year',$e->year);
		$this->assignRef('day',$e->day);
		$raw=false;
		$this->assignRef('raw',$raw);
		$type=null;
		if ($d>0){
			$lDesc=& $e->createLongDescDay($d,$e->month,$e->year);
			$this->assignRef('lDesc',$lDesc);
			$type='desc';
		}
		$this->assignRef('type',$type);
		parent::display();
	}
}
